home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 16 / 016.d81 / t.lk.conway's li < prev    next >
Text File  |  2022-08-26  |  5KB  |  287 lines

  1.  
  2.      About Conway's Game of Life
  3.      ===== ======== ==== == ====
  4.  
  5.      written by: Joel Ellis Rea
  6.             for: COMAL Corner
  7.  
  8.  
  9.   This program is written as a COMAL
  10.  
  11. Kernal-compatible LIST file.  That
  12.  
  13. means you must have either COMAL 0.14
  14.  
  15. on disk (available from Loadstar), or
  16.  
  17. COMAL 2.0 on cartridge (available from
  18.  
  19. Commodore or the COMAL User's Group,
  20.  
  21. USA).  Since it is a LIST (SEQ) file,
  22.  
  23. it must be ENTERed, not LOADed, into
  24.  
  25. memory.  Just type (while in COMAL
  26.  
  27. with this disk in the drive):
  28.  
  29.  
  30.  
  31.    NEW   _ REQUIRED for 0.14,
  32.            optional for 2.0!
  33.  
  34.    ENTER"LK.CONWAY'S LIFE"
  35.  
  36.    < Insert formatted disk now >
  37.  
  38.    SAVE"C.CONWAY'S LIFE"  _ 0.14, OR
  39.    SAVE"C2.CONWAY'S LIFE" _ 2.0.
  40.  
  41.  
  42.    From then on, you may LOAD and RUN
  43.  
  44. the program in a single step simply by
  45.  
  46. typing:
  47.  
  48.  
  49.    CHAIN"C.CONWAY'S LIFE"  _ 0.14
  50.  
  51.                 - OR -
  52.  
  53.    RUN"C2.CONWAY'S LIFE"   _ 2.0
  54.  
  55.  
  56. from the appropriate COMAL.
  57.  
  58.  
  59.    This program is an implementation
  60.  
  61. of a mathematical simulation invented
  62.  
  63. by mathematician John Conway.  He
  64.  
  65. called it "LIFE", because by using 3
  66.  
  67. simple rules, he could simulate the
  68.  
  69. growth of colonies of hypothetical
  70.  
  71. single-celled organisms.  These cells
  72.  
  73. are arranged in a rectangular (X-Y)
  74.  
  75. coordinate system (i.e. rows and col-
  76.  
  77. umns).  The rules are:
  78.  
  79.  
  80.    #1.  All births and deaths occur
  81.         simultaneously in a given
  82.         generation.
  83.  
  84.    #2.  A "live" cell with exactly
  85.         2 or 3 neighbors will survive
  86.         to the next generation.  All
  87.         others will "die" (either from
  88.         isolation or overcrowding).
  89.  
  90.    #3.  An empty "cell" with exactly
  91.         3 neighbors will become a
  92.         "live" cell in the next gen-
  93.         eration.
  94.  
  95.  
  96.    That's it!  A "neighbor" is defined
  97.  
  98. as a "live" cell adjacent to the cell
  99.  
  100. in question, either horizontally,
  101.  
  102. vertically or diagonally.  Thus, each
  103.  
  104. cell may have from 0 to 8 neighbors!
  105.  
  106.  
  107.    From these simple rules and a sim-
  108.  
  109. ple starting pattern, very complex and
  110.  
  111. beautiful patterns may form over the
  112.  
  113. course of succeeding generations.
  114.  
  115. From a particular starting pattern,
  116.  
  117. one of the following may happen:
  118.  
  119.  
  120.    #1.  The colony will eventually
  121.         die out completely
  122.  
  123.    #2.  The colony will stabilize
  124.         into a cycling pattern.  The
  125.         cycle may have a period of 1,
  126.         and therefore not appear to
  127.         change at all, or may have a
  128.         very large period, in which
  129.         case a human might not notice
  130.         the cycling!
  131.  
  132.    #3.  The colony will change and
  133.         grow forever, never dying out
  134.         and never cycling (repeating).
  135.         No pattern has been found that
  136.         does this, but it has not been
  137.         proven mathematically impos-
  138.         sible!
  139.  
  140.  
  141.    If a pattern is asymmetrical, it
  142.  
  143. will tend to become symmetrical.  Once
  144.  
  145. it becomes symmetrical, it can never
  146.  
  147. lose its symmetry.  (Theoretically,
  148.  
  149. that is.  In real "life" and this pro-
  150.  
  151. gram, the "world" has borders!)
  152.  
  153.  
  154.    When the program starts, you will
  155.  
  156. have a blank screen and a circular
  157.  
  158. "cursor" that you may move with the
  159.  
  160. arrow keys, or "A" for up, "Z" for
  161.  
  162. down, "<" for left and ">" for right.
  163.  
  164. Pressing SPACE will place a dot (live
  165.  
  166. cell) at that spot if empty, or re-
  167.  
  168. move a live cell.  Press RETURN when
  169.  
  170. done entering your starting pattern
  171.  
  172. and the program will commence.
  173.  
  174.  
  175.    This program actually uses the text
  176.  
  177. screen and the color memory for work-
  178.  
  179. ing storage.  There are no "arrays" in
  180.  
  181. memory keeping track of the cells and
  182.  
  183. their neighbors.  The color of a given
  184.  
  185. cell reflects how many neighbors it
  186.  
  187. has.  Thus, a RED cell has 2 neighbors
  188.  
  189. (RED = color 2), and thus will survive
  190.  
  191. to the next generation.  At the begin-
  192.  
  193. ning of each generation, all cells are
  194.  
  195. set to BLACK (color 0).
  196.  
  197.  
  198.    The program does not actually count
  199.  
  200. how many neighbors each cell has.  In-
  201.  
  202. stead, it takes each "live" cell, and
  203.  
  204. increments the color of each surround-
  205.  
  206. ing cell, thus exerting a "neighborly"
  207.  
  208. influence on the surrounding cells!
  209.  
  210.  
  211.    Here are some good starting pat-
  212.  
  213. terns to try:
  214.  
  215.  
  216.                 **
  217.                **    "R Pentomino"
  218.                 *
  219.  
  220. R Pentomino comes quite close to ful-
  221.  
  222. filling result #3 -- infinite growth!
  223.  
  224. It has been observed to have a cycle
  225.  
  226. period well over 1000!
  227.  
  228.  
  229.                ***
  230.                 *
  231.                 *
  232.                 *   "I-Beam"
  233.                 *
  234.                 *
  235.                ***
  236.  
  237.  
  238. I-Beams produce beautiful bi-symmetri-
  239.  
  240. cal patterns.  These patterns vary ac-
  241.  
  242. cording to the height of the central
  243.  
  244. beam, and whether said beam has an odd
  245.  
  246. or even number of dots!
  247.  
  248.  
  249.               *     *
  250.                *   *
  251.                 * *
  252.                  *    "Big X"
  253.                 * *
  254.                *   *
  255.               *     *
  256.  
  257. Big X's produce lovely poly-symmetri-
  258.  
  259. cal patterns.  These vary on the size
  260.  
  261. of the X, and whether the two "arms"
  262.  
  263. meet at one dot (as above), or four
  264.  
  265. (like this:
  266.  
  267.                 *  *
  268.                  **
  269.                  **
  270.                 *  * )
  271.  
  272.  
  273.  
  274.   Because this program is written in
  275.  
  276. COMAL, you cannot RUN it from the
  277.  
  278. LOADSTAR environment.  The program is
  279.  
  280. on Side 2 of this issue.  It is saved
  281.  
  282. under the name of LK.CONWAY'S LIFE.
  283.  
  284.  
  285. =========== End of Article ===========
  286.  
  287.